#pragma once

#include "BaseLPCArray.cpp"

class CLPCSTRArray :public CBaseLPCArray<LPCSTR>
{
public:
	CLPCSTRArray();
	CLPCSTRArray(intptr_t initCount, intptr_t maxLen);
	CLPCSTRArray(LPCSTR s, LPCSTR sepStr);
	CLPCSTRArray(LPCSTR s, char sepChar);
	CLPCSTRArray(LPCWSTR s, LPCSTR sepStr, UINT codePage);
	virtual ~CLPCSTRArray();
	void buildW(LPCWSTR s, LPCSTR sepStr, UINT codePage);
	void makeLower();
protected:
	intptr_t getLength(LPCSTR p) override { return (intptr_t)strlen(p); };
	intptr_t getSingleCharLength() override { return sizeof(char); };
	LPCSTR find(LPCSTR p, LPCSTR s) override { return strstr(p, s); };
	LPCSTR find(LPCSTR p, char c) override;
};

class CLPCWSTRArray :public CBaseLPCArray<LPCWSTR>
{
public:
	CLPCWSTRArray();
	CLPCWSTRArray(LPCWSTR s, LPCWSTR sepStr);
	CLPCWSTRArray(LPCWSTR s, char sepChar);
	virtual ~CLPCWSTRArray();
	void sort(bool desc = false);

protected:
	intptr_t getLength(LPCWSTR p)  override { return (intptr_t)wcslen(p); };
	intptr_t getSingleCharLength()  override { return sizeof(wchar_t); };
	LPCWSTR find(LPCWSTR p, LPCWSTR s) override { return wcsstr(p, s); };
	LPCWSTR find(LPCWSTR p, char c)  override { return wcschr(p, c); };
};

